package com.lngsyz.ywtb.biz.service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lngsyz.ywtb.entity.source1.SystemDic;
import com.lngsyz.ywtb.mapper.source1.SystemDicMapper;

import net.logstash.logback.encoder.org.apache.commons.lang.StringUtils;

@Service
public class SystemDicService {
    
	@Autowired
	SystemDicMapper systemDicMapper;
	
    public List<SystemDic> findByType(String type){
    	if(StringUtils.isNotBlank(type)) {
    		Map<String, Object> param = new HashMap<String, Object>();
    		param.put("type", type);
    		List<SystemDic> dics = systemDicMapper.findByCondition(param);
    		return dics;
    	} else {
    		return new ArrayList<SystemDic>();
    	}
    }
    
    public List<SystemDic> findDistrictByCity(String districtCity){
    	if(StringUtils.isNotBlank(districtCity)) {
    		Map<String, Object> param = new HashMap<String, Object>();
    		param.put("type", "21");
    		param.put("code", districtCity);
    		List<SystemDic> dics = systemDicMapper.findDistrictByCity(param);
    		return dics;
    	} else {
    		return new ArrayList<SystemDic>();
    	}
    }
}
